package com.zeta.system.model.vo;

import com.zeta.system.model.dto.SysRoleDTO;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.zetaframework.core.desensitization.annotation.Desensitization;

import java.io.Serial;
import java.io.Serializable;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.List;

/**
 * 用户分页查询结果，分页查询用
 * <p>
 * 说明：<br>
 * 用户的`账号`、`密码`、`邮箱`、`手机号`等字段较为隐私，故进行了脱敏处理
 *
 * @author gcc
 */
@Data
@Schema(description = "用户分页查询结果")
public class SysUserPageVO implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    /** id */
    @Schema(description = "id")
    private Long id;

    /** 创建时间 */
    @Schema(description = "创建时间")
    private LocalDateTime createTime;

    /** 创建人 */
    @Schema(description = "创建人")
    private Long createdBy;

    /** 修改时间 */
    @Schema(description = "修改时间")
    private LocalDateTime updateTime;

    /** 修改人 */
    @Schema(description = "修改人")
    private Long updatedBy;

    /** 状态 */
    @Schema(description = "状态")
    private Integer state;

    /** 用户名 */
    @Schema(description = "用户名")
    private String username;

    /** 账号 */
    @Desensitization(rule = "3_4") // 账号脱敏
    @Schema(description = "账号")
    private String account;

    /** 密码 */
    @Desensitization(rule = "3_4") // 密码脱敏
    @Schema(description = "密码")
    private String password;

    /** 邮箱 */
    @Desensitization(rule = "3~@") // 邮箱脱敏
    @Schema(description = "邮箱")
    private String email;

    /** 手机号 */
    @Desensitization(rule = "3_4") // 手机号脱敏
    @Schema(description = "手机号")
    private String mobile;

    /** 性别 0未知 1男 2女 */
    @Schema(description = "性别 0未知 1男 2女")
    private Integer sex;

    /** 头像 */
    @Schema(description = "头像")
    private String avatar;

    /** 生日 */
    @Schema(description = "生日")
    private LocalDate birthday;

    /** 用户角色 */
    @Schema(description = "用户角色")
    private List<SysRoleDTO> roles;

}
